CC = g++
CFLAGS = -Wall
MYSQLPP = -I/usr/include/mysql++/ -I /usr/include/mysql/
SOCKET = -I/usr/local/include/Sockets/

LIBDIR = -L/usr/lib/ -L/usr/local/lib/
LIBS = -lpthread -lSockets -lmysqlpp -lmysqlclient

all : utility Account Connection main

tts : 
	g++ -o TripleTriadServer -O2 -g \
	obj/utility.o \
	obj/Database.o obj/Account.o obj/Session.o obj/Connection.o obj/main.o $(LIBDIR) $(LIBS) 

#       obj/Card.o obj/Cardset.o obj/Cardsets.o obj/Element.o obj/Elements.o \
	
loadData :
	$(CC) $(CFLAGS) -c caricamentoDati/Card.cpp -o obj/Card.o $(LIBDIR) $(LIBS) 
	$(CC) $(CFLAGS) -c caricamentoDati/Cardset.cpp -o obj/Cardset.o $(LIBDIR) $(LIBS) 
	$(CC) $(CFLAGS) -c caricamentoDati/Cardsets.cpp -o obj/Cardsets.o $(LIBDIR) $(LIBS) 
	$(CC) $(CFLAGS) -c caricamentoDati/Element.cpp -o obj/Element.o $(LIBDIR) $(LIBS) 
	$(CC) $(CFLAGS) -c caricamentoDati/Elements.cpp -o obj/Elements.o $(LIBDIR) $(LIBS) 
	
utility :
	$(CC) $(CFLAGS) -c utility.cpp -o obj/utility.o $(LIBDIR) $(LIBS) 

Account :
	$(CC) $(CFLAGS) $(MYSQLPP) $(SOCKET) -c Account.cpp -o obj/Account.o $(LIBDIR) $(LIBS) 

Connection : 
	$(CC) $(CFLAGS) $(SOCKET) $(MYSQLPP) -c Connection.cpp -o obj/Connection.o $(LIBDIR) $(LIBS) 
	$(CC) $(CFLAGS) $(SOCKET) -c Session.cpp -o obj/Session.o $(LIBDIR) $(LIBS) 

main : 
	$(CC) $(CFLAGS) $(MYSQLPP) $(SOCKET) -c Database.cpp -o obj/Database.o $(LIBDIR) $(LIBS) 
	$(CC) $(CFLAGS) $(MYSQLPP) $(SOCKET) -c main.cpp -o obj/main.o $(LIBDIR) $(LIBS) 
	
clean : 
	rm obj/*.o TripleTriadServer
